<template>
	<view class="list-page" :style="!loading ? 'opacity: 0;' : 'opacity: 1;'">
		<!--  v-model="dataList" @query="queryList" -->
		<!--  refresher-only @onRefresh="onRefresh" -->
		<pageTxt>
			<listTabCom class="listTabCom" :tabList="topTabList" @topTabClick="topTabClick" :current="topTabIndex"></listTabCom>
			<!-- 施工管理 -->
			<!-- <constructionManagement :option="{}" :conentHeight="conentHeight" v-if="topTabIndex == 0"></constructionManagement> -->
		</pageTxt>
	</view>
</template>

<script>
export default {
	data() {
		return {
			loading: false,
			dataList: [],
			conentHeight: 0,
			topTabIndex: 0,
			topTabList: [
				{
					name: '施工管理'
				},
				{
					name: '施工日志'
				},
				{
					name: '质量验收'
				},
				{
					name: '工程整改'
				},
				{
					name: '售后管理'
				}
			]
		};
	},
	onLoad(option) {
		this.getHeight();
		if (option.tabIndex) {
			this.topTabIndex = option.tabIndex;
		}
	},
	methods: {
		getHeight() {
			// 创建节点查询
			let that = this;
			const systemInfo = uni.getSystemInfoSync();
			const query = uni.createSelectorQuery().in(that);
			query.select('.listTabCom').boundingClientRect();
			query.exec((res) => {
				that.conentHeight = systemInfo.screenHeight - (res[0].height + 20); //组件可用高度 20状态栏高度（动态获取高度不包含状态栏高度）
				setTimeout(() => {
					that.loading = true;
				}, 0);
			});
		},
		topTabClick(index) {
			this.topTabIndex = index;
		}
	}
};
</script>

<style lang="scss" scoped></style>
